﻿using System;
using System.Collections.Generic;
using System.Text;
using XDesigner.Writer.Controls;
using XDesigner.Writer.Dom;

namespace XDesigner.Writer.Test
{
    public class ListElementValueEditor : XDesigner.Writer.Controls.ElementValueEditor 
    {
        public override bool EditValue(TextWindowsFormsEditorHost host, ElementValueEditContext context )
        {
            XTreeListBoxEditControl ctl = new XTreeListBoxEditControl();
            ctl.EditorHost = host;
            ctl.ShowDropDown();
            string text = ctl.ListBox.SelectedText;
            if (text != null)
            {
                host.Document.BeginLogUndo();
                host.Document.EndLogUndo();
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
